package com.inibb.app.po;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

@Entity
@Table(name = "GOODS")
public class Goods extends BasePO implements java.io.Serializable{
	
	
	private static final long serialVersionUID = 1L;
	private Integer goodsId;
	private String goodsNo;
	private String name;
	private String name2;
	private String name3;
	private String desp;
	private String desp2;
	private String desp3;
	private Integer goodsTypeId;
	private String price;
	private String brand;
	private String unit;
	private String instore;
	private String actvInd;
	private String hot;
	private String newArrival;
	
	private List<GoodsPicRef> goodsPicRefs;

	@Id
	@Column(name = "GOODS_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@OrderBy("ASC")
	public Integer getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Integer id) {
		this.goodsId = id;
	}
	
	@Column( name="NAME", length=POConstants.NAME_FIELD_LENGTH )
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column( name="DESP", length=POConstants.LONG_TEXT_FIELD_LENGTH )
	public String getDesp() {
		return desp;
	}
	public void setDesp(String desp) {
		this.desp = desp;
	}
//	@Column( name="GOODS_TYPE" )
//	public Integer getType() {
//		return type;
//	}
//	public void setType(Integer type) {
//		this.type = type;
//	}
	@Column( name="PRICE", length=POConstants.PRICE_FIELD_LENGTH )
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	@Column( name="ACTV_IND", length=POConstants.IND_LENGTH )
	public String getActvInd() {
		return actvInd;
	}
	public void setActvInd(String actvInd) {
		this.actvInd = actvInd;
	}
	@Column( name="BRAND", length=POConstants.SHORT_STR_FIELD_LENGTH )
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	
	@Column( name="GOODS_TYPE_ID" )
	public Integer getGoodsTypeId() {
		return goodsTypeId;
	}

	public void setGoodsTypeId(Integer goodsTypeId) {
		this.goodsTypeId = goodsTypeId;
	}

	@OneToMany(fetch=FetchType.EAGER,mappedBy="goods",cascade = { CascadeType.ALL })
	public List<GoodsPicRef> getGoodsPicRefs() {
		return goodsPicRefs;
	}

	public void setGoodsPicRefs(List<GoodsPicRef> goodsPicRefs) {
		this.goodsPicRefs = goodsPicRefs;
	}
	@Column( name="GOODS_NO" )
	public String getGoodsNo() {
		return goodsNo;
	}

	public void setGoodsNo(String goodsNo) {
		this.goodsNo = goodsNo;
	}
	@Column( name="UNIT" )
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	@Column( name="INSTORE" )
	public String getInstore() {
		return instore;
	}

	public void setInstore(String instore) {
		this.instore = instore;
	}
	@Column( name="HOT" )
	public String getHot() {
		return hot;
	}

	public void setHot(String hot) {
		this.hot = hot;
	}
	@Column( name="NEW_ARRIVAL" )
	public String getNewArrival() {
		return newArrival;
	}

	public void setNewArrival(String newArrival) {
		this.newArrival = newArrival;
	}
	@Column( name="NAME2" )
	public String getName2() {
		return name2;
	}

	public void setName2(String name2) {
		this.name2 = name2;
	}
	@Column( name="NAME3" )
	public String getName3() {
		return name3;
	}

	public void setName3(String name3) {
		this.name3 = name3;
	}
	@Column( name="DESP2" )
	public String getDesp2() {
		return desp2;
	}

	public void setDesp2(String desp2) {
		this.desp2 = desp2;
	}
	@Column( name="DESP3" )
	public String getDesp3() {
		return desp3;
	}

	public void setDesp3(String desp3) {
		this.desp3 = desp3;
	}	
	
}
